package org.example.top41_80;

import java.sql.SQLOutput;
import java.util.Scanner;

public class main47 {
    //x的平方根  输入：x = 8   输出：2
    //思路：[0,x] 左闭右闭 (long)mid*mid int x值没有超，x*x却超了
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int res=mySqrt(x);
        System.out.println(res);
    }

    private static int mySqrt(int x) {
        int left=0;
        int right=x;
        int res=-1;
        while (left<=right){
            int mid=(left+right)/2;
            if((long)mid*mid<=x){
                left=mid+1;
                res=mid;
            }else {
                right=mid-1;
            }
        }
        return  res;

    }
}
